//some classes that are useful for using random numbers in simulations
#include <random>

//SimpleKeyGenerator is used when we need a random generated key
//the key is using the standard random library
//hence it might not be useful for true secure applications
//however, for my silulations it is sufficient
class SimpleKeyGenerator{

 private:
  std::default_random_engine randGen;
  
 public:
  SimpleKeyGenerator(){}

  //create a key with length given by bits
  //the maximum length is 64 (size of unsigned long long)
  unsigned long long getKey(int bits){
    unsigned long long maxKey=(1uLL<<bits)-1;
    std::uniform_int_distribution<unsigned long long> distribution(0,maxKey);
    return distribution(randGen);
  }

  //create a key with length given by bits
  //for this method the key can never be allzero
  //the maximum length is 64 (size of unsigned long long)
  unsigned long long getKeyNot0(int bits){
    unsigned long long maxKey=(1uLL<<bits)-1;
    std::uniform_int_distribution<unsigned long long> distribution(1,maxKey);
    return distribution(randGen);
  }
  
}; 
